<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditExporterTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="اسم المورد" for="exporterName" />
                    <h:inputText id="exporterName" value="#{exporterController.selected.exporterName}" title="#{bundle.EditExporterTitle_exporterName}" required="true" requiredMessage="#{bundle.EditExporterRequiredMessage_exporterName}"/>
                    <h:outputLabel value="كود المورد" for="exporterCode" />
                    <h:inputText id="exporterCode" value="#{exporterController.selected.exporterCode}" title="#{bundle.EditExporterTitle_exporterCode}" required="true" requiredMessage="#{bundle.EditExporterRequiredMessage_exporterCode}"/>
                    
                    <h:outputLabel value="التليفون" for="phone" />
                    <h:inputText id="phone" value="#{exporterController.selected.phone}" title="#{bundle.EditExporterTitle_phone}" />
                    <h:outputLabel value="الرصيد" for="balance" />
                     <h:panelGroup rendered="#{!(exporterController.selected.balance > 0)}">
                    <h:inputText  value="#{exporterController.selected.balance*-1}" title="#{bundle.EditExporterTitle_balance}" />
                   
                     </h:panelGroup>
                    <h:panelGroup rendered="#{exporterController.selected.balance > 0}" >
                        <h:inputText id="balance" value="#{exporterController.selected.balance}" title="#{bundle.EditExporterTitle_balance}" />
                   
                    </h:panelGroup>
                    <h:selectBooleanCheckbox value="#{exporterController.boolean1}"  />لينا
                    <h:outputLabel value="اخري" for="other" />
                    <h:inputText id="other" value="#{exporterController.selected.other}" title="#{bundle.EditExporterTitle_other}" />
                   </h:panelGrid>
                <center>
                <h:commandButton action="#{exporterController.update}" value="تعديل" class="btn btn-primary" />
                
               
                <h:commandButton action="#{exporterController.prepareList}" value="رجوع" immediate="true" class="btn btn-primary"/>
                </center>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
